package com.hz.filemanager.model.file;

import com.hz.filemanager.expendable_recyclerview.BaseExpandableRecyclerViewAdapter;

import java.io.Serializable;
import java.util.List;

public class MusicFolder implements Serializable , BaseExpandableRecyclerViewAdapter.BaseGroupBean<Music> {

    private String name;
    private String dir;
    private List<Music> musics;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDir() {
        return dir;
    }

    public void setDir(String dir) {
        this.dir = dir;
    }

    public List<Music> getMusics() {
        return musics;
    }

    public void setMusics(List<Music> musics) {
        this.musics = musics;
    }

    @Override
    public int getChildCount() {
        if(musics != null)
            return musics.size();
        return 0;
    }

    @Override
    public Music getChildAt(int childIndex) {
        if(musics != null && musics.size()>=childIndex)
            return musics.get(childIndex);
        return null;
    }

    @Override
    public boolean isExpandable() {
        return getChildCount() > 0;
    }
}
